#ifndef MY_ACCOUNT_H
#define MY_ACCOUNT_H

#include <QDebug>
#include <pjsua2.hpp>
#include <iostream>
#include "my_call.h"

class My_account :public QObject,public Account
{
    Q_OBJECT
public:
    My_account(QObject *parent = nullptr):QObject(parent){

    }
    ~My_account();

    OnIncomingCallParam incomIprm;

    MyCall* incomCall = nullptr;

    MyCall* callUp = nullptr;

    void UseRemoteUrlMakeACall(string remoteUrl);

    void sendInstantMessageToRemote(string message);

    void answerReceiveCall(void);

    void hangUpCall(void);

    bool HoldCall();

    bool ReinviteCall();

    void startPlayWavToRemote(void);

    void stopPlayWavToRemote(void);

    string getRemoteUrl(void);

    void cleanExistCall(void);

    virtual void onRegState(OnRegStateParam &prm);

    virtual void onIncomingCall(OnIncomingCallParam &iprm);

private:
    MyCall** checkHaveCallIsActiveAndBackPtr(void);

signals:
    void incomingCallSignal(OnIncomingCallParam* incomIprm);

    void EOnCallStateOverChange(void);

    void EOnCallMediaStateChange(void);

    void EOnInstantMessageChange(OnInstantMessageParam* prm);

};
#endif // MY_ACCOUNT_H
